home *** CD-ROM | disk | FTP | other *** search
- Path: muccmail.missouri.edu!menghua_wang
- From: menghua_wang@muccmail.missouri.edu (menghua wang)
- Newsgroups: comp.lang.c++
- Subject: question assignment operator in c++
- Date: Wed, 6 Mar 1996 15:27:29 UNDEFINED
- Organization: University of Missouri - Columbia
- Message-ID: <menghua_wang.1.002DB7BE@muccmail.missouri.edu>
- NNTP-Posting-Host: 128.206.21.60
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]
-
- I do not why the assignment operator can only be overloaded as a member
- function in a class such as:
-
- class myclass {
- int i;
- public:
- myclass operator= (myclass &A) {
- i = A.i;
- return *this;
- }
- };
-
- Why does not the following frind overloading work?
-
- mycalss operator= (myclass &A, myclass &B) {
- A.i = B.i;
- return A;
- }
-
- thank you for your help
-
-